import LayoutChangeByMeminfo from "@/components/LaoutChangeByMeduinfo/index";
import FriendsList from "./FriendsList";
import { useRef } from "react";
import Context from "./context";
const Message = () => {
  const elRef = useRef<HTMLDivElement>(
    null
  ) as React.MutableRefObject<HTMLDivElement>;
  const getList = { getFriendList: () => {} };
  const callback = (getFriendList: () => void) => {
    Object.defineProperty(getList, "getFriendList", {
      value: getFriendList,
      enumerable: true,
      writable: true
    });
  };
  return (
    <>
      <Context.Provider value={getList}>
        <LayoutChangeByMeminfo elRef={elRef}>
          <FriendsList onContext={callback}></FriendsList>
        </LayoutChangeByMeminfo>
      </Context.Provider>
    </>
  );
};

export default Message;
